<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="net.ojbk.timeAxis.service.*" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>时光发布页面</title>
    <link href="css/bootstrap-jf.min.css" rel="stylesheet">
    <link href="css/datepicker3-jf.css" rel="stylesheet">
    <link href="css/styles-jf.css" rel="stylesheet">
</head>

	<%
	boolean isLogin = false;
	String userId = null;
	String axisId = null;
	if ((session != null && session.getAttribute("login") != null && (boolean)session.getAttribute("login"))) { //如果登录
		userId = (String) session.getAttribute("userId");
		
		axisId = request.getParameter("axisId");
		
		isLogin = true;
	}
	%>
	
<body>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="home.jsp"><span>师易</span>时光印记平台</a>
                <ul class="user-menu">
                    <li class="dropdown pull-right">
                        <a href="index.jsp" class="dropdown-toggle">个人主页</a>
                    </li>
                </ul>
            </div>

        </div><!-- /.container-fluid -->
    </nav>

    <div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
        <form role="search">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="欢迎来到师易时光印记">
            </div>
        </form>
        <ul class="nav menu">
           <!--  <li><a href="all.jsp"><span class="glyphicon glyphicon-stats"></span> 全部赛事</a></li> 
            <li role="presentation" class="divider">主办方</li>   -->
            <li  class="active"><a href="launch.jsp"><span class="glyphicon glyphicon-list-alt"></span>发布赛事</a></li>
           <!--  <li><a href="havaLaunch.jsp"><span class="glyphicon glyphicon-dashboard"></span>已发布赛事</a></li>
            <li><a href="Statistics.jsp"><span class="glyphicon glyphicon-th"></span> 赛事情况统计</a></li>
            <li><a href="backstage.jsp"><span class="glyphicon glyphicon-th"></span> 赛事后台</a></li>
            <li role="presentation" class="divider">参赛方</li>  
            <li><a href="part.jsp"><span class="glyphicon glyphicon-user"></span> 参赛赛事</a></li>
            <li><a href="havaPart.jsp"><span class="glyphicon glyphicon-user"></span> 已赛赛事</a></li> -->
        </ul>
        <div class="attribution">时光印记 by <a href="">师易</a></div>
    </div><!--/.sidebar-->

<% if(isLogin && axisId != null && !axisId.equals("null")) {%>
    <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">           
        <div class="row">
            <ol class="breadcrumb">
                <li><a href="all.jsp"><span class="glyphicon glyphicon-home"></span></a></li>
                <li class="active">Launch</li>
            </ol>
        </div><!--/.row-->

        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">时光轴：<%= axisId %></h1>
            </div>
        </div><!--/.row-->


        <div class="row">
            <div class="col-lg-12">
                <div class="panel panel-default">
                    <div class="panel-heading">时光印记 - 发布时光</div>
                    <div class="panel-body">
                        <div class="">
                            <form role="form" action="timeServlet" method="post" enctype="multipart/form-data">
                                <div class="form-group" >
                                    <fieldset style="border:1px solid black;padding:5px 5px 10px;wrid">
                                        <label>时光叶片</label>
                                        <hr >
                                        <div class="form-row">
                                            <div class="field-label"><label for="field1">时光标题</label>:</div>
                                            <div class="field-widget"><input name="title" id="field1" class="form-control" title="Enter your title" /></div>
                                        </div>

                                        <div class="form-row">
                                            <div class="field-label"><label for="field2">时光内容</label>:</div>
                                            <div class="field-widget">
                                            <!-- line-height: 70px -->
                                            <textarea cols="50" rows="10" class="form-control" style="" name="content"></textarea></div>
                                        </div>

                                        <div class="form-row">
                                            <div class="field-label"><label for="field3">时光照片</label>:</div>
                                            <div class="field-widget"><input name="img0" id="field2" type="file" class="form-control" title="Enter your name" /></div>
                                        </div>
                                        <div class="form-row">
                                            <div class="field-label"><label for="field7">时光密码：</label></div>
                                            <div class="field-widget"><input name="timePW" id="field7" class="form-control"  title="Enter a password greater than 6 characters" /></div>
                                        </div>    
                                    </fieldset>   
                                </div>


                                <div  style="position: absolute; bottom: -70px; left: 40px;">
                                    <input type="hidden" name="type" value="publishTime">
                                    <input type="hidden" name="axisId" value="<%= axisId %>">
                                    <button type="submit" class="btn btn-primary">Submit Button</button>
                                    <button type="reset" class="btn btn-default">Reset Button</button>
                                </div>
                            </form>

                                </div>
                            </div>
                        </div>
                </div><!-- /.col-->
            </div><!-- /.row -->
        
        </div><!--/.main-->
<% } else {
	out.println("未登录或未选择待发布的时光轴");
} %>
            <script src="js/jquery-1.11.1.min-jf.js"></script>
            <script src="js/bootstrap.min-jf.js"></script>
            <script src="js/chart.min-jf.js"></script>
            <script src="js/chart-data-jf.js"></script>
            <script src="js/easypiechart-jf.js"></script>
            <script src="js/easypiechart-data-jf.js"></script>
            <script src="js/bootstrap-datepicker-jf.js"></script>
            <script>
                !function ($) {
                    $(document).on("click","ul.nav li.parent > a > span.icon", function(){        
                        $(this).find('em:first').toggleClass("glyphicon-minus");      
                    }); 
                    $(".sidebar span.icon").find('em:first').addClass("glyphicon-plus");
                }(window.jQuery);

                $(window).on('resize', function () {
                    if ($(window).width() > 768) $('#sidebar-collapse').collapse('show')
                })
                $(window).on('resize', function () {
                    if ($(window).width() <= 767) $('#sidebar-collapse').collapse('hide')
                })
        </script>   
    </body>

    </html>